package com.igeek.javase.interfaces.storage;

/**
 * @author chenmin
 * 2023/7/14 19:12
 * @description TODO
 *
 *                IService ->   IDao
 * Controller ->  Service  ->   Dao
 *
 * 面向接口编程 - 可插拔式编程
 * 1.拓展性好
 * 2.维护性高
 */

public class Computer {

    private IStorage storage;
    public Computer(IStorage storage){
        this.storage = storage;
    }

    public void readDate(){
        System.out.println("电脑开始读数据");
        storage.read();
    }

    public void writeDate(){
        System.out.println("电脑开始写数据");
        storage.write();
    }
}
